import { createRouter, createWebHistory} from "vue-router"

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'main-page',
            component: () => import('@/views/MainPage.vue'),
            children: [
                {
                    path: 'login',
                    name:'login-page',
                    component: () =>import('@/components/auth/LoginPage.vue')
                },
                {
                    path: 'register',
                    name: 'register',
                    component: () => import('@/components/auth/RegisterPage.vue')
                }
            ]
        },
        {
            path: '/chat',
            name: 'chat-page',
            component: () => import('@/views/ChatPage.vue'),
            children: [
                {
                    path: '',
                    name: 'generic-page',
                    component: () => import('@/components/chat/GenericSetPage.vue')
                },
                {
                    path: 'account-set',
                    name: 'account-page',
                    component: () => import('@/components/chat/AccountSetPage.vue')
                }
            ]
        },
        {
            path: '/forget',
            name: 'forget-page',
            component: () => import('@/views/ForgetPage.vue'),
        }
    ]
})

export default router